package com.ease.juc.utils;

import java.util.concurrent.atomic.AtomicInteger;

/**
 * @author: chenhs
 * @date: Created in 15:59 2021/10/17
 **/
public class CounterAtomic implements Counter {

    private AtomicInteger i = new AtomicInteger(0);

    @Override
    public void incr() {
        i.incrementAndGet();
    }

    @Override
    public void desc() {
        i.decrementAndGet();
    }

    @Override
    public Integer getResult() {
        return i.get();
    }
}
